package com.zjx;


import com.zjx.Service.StudentService;
import com.zjx.entity.Student;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainTest {

	public static void main(String[] args) throws Exception {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring/spring-tx-config.xml");
		StudentService studentService1 = (StudentService) context.getBean("studentService");
		Student student1 = new Student();
		student1.setName("A");
		student1.setAge(19);
		student1.setSex("女");
		//保存一条记录
		studentService1.save(student1);
		//测试添加是没有异常，但是在添加事务中有别的事务，删除

	}
}
